﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">



</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="FeaturedContent" runat="server">
    <%-- <section class="featured">
 <div class="content-wrapper" style="height:60px">
            <hgroup class="title float-left">
                <h1>LOGIN</h1>
            </hgroup> 
 </div>

 </section>--%>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="TableContent" runat="server">
    <table style="margin-top: 25px; width:75%" class="fontTB">
      <tr style="border-top: 1px solid #000!important; height: 65px;">
         <td colspan="2" class="cell head" style="text-align: left;width:25%">
            BIAS Login.
         </td>
      </tr>
      
      
      <tr style="height: 35px">
         <td class="head cell">
            Bias Code :
         </td>
         <td class="desc">
            <input id="txtcode" type="password" value="" name="code" 
                 onkeydown="checkEnter()" />
         </td>
      </tr>
      <tr style="height: 35px">
         <td class="head cell">
            NAME :
         </td>
         <td class="desc">
   
            <input id="txtname" type="text" maxlength="30" value=""/>
         </td>
      </tr>
      <tr class="head">
         <td style="height: 35px; text-align: right;">
            <button id="exit">
               Exit</button>
         </td>
         <td style="height: 35px; text-align: left;">
            <button id="save">LogIn</button>
         </td>
      </tr>
   </table>

</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="ScriptsSection" runat="server">
    <style type="text/css">
      .fontTB
      {
         font-size: 18pt !important;
      }
            #txtcode ,#txtShift ,#txtname
      {
         font-size:1em; height:2em;
         line-height:2.5em;
         width:350px;
      } 
      </style>
   <% if (false)
      { %>
   <script src="../../Scripts/jquery-1.7.2.js" type="text/javascript"></script>
   <% } %>

   <script type="text/javascript">
       function checkEnter() {
          if(event.keyCode==13) $("#txtname").focus();
       }
       $(function () {
           $("#txtcode").focus();
    
           $("#save").button({
               icons: { primary: "" }
           }).click(function () {
               var code = $("#txtcode").val();
               if (code == "") {
                   alert("ระบุ Topping Code ! ");
                   $("#code").focus();
                   return;
               }

               if ($("#txtname").val() == "") {
                   alert("ระบุ Name ! ");
                   $("#txtname").focus();
                   return;
              }
          
               var emp = $("#txtname").val();
               var url = '<%=Url.Action("Register","BiasHead") %>?emp=' + emp + '&code=' + $.trim(code);
               $.post(url, function (data) {
                   if (data.success != "0") {
                       $("#txtcode").val("");                   
                       $("#txtname").val("")
                       var getUsersUrl = data.gotoURL
                       window.open(getUsersUrl, "BiasProcess", "fullscreen=yes, location=no, menubar=no, resizable=no, " +
                                                "scrollbars=no, status=no, titlebar=no, toolbar=no");
                   } else alert(data.message);

               });



           }); //click


           $("#exit").button({
               icons: { primary: "" }
           }).click(function () {
               window.close();
           });
           $("#txtShift").setMask("3");

       });
      
      
   </script>




</asp:Content>
